home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8885 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: interramp.com!usenet
  2. From: "James A. Clifton" <jclifton@interramp.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Help referencing an array of strings
  5. Date: Wed, 06 Mar 1996 12:56:24 -0500
  6. Organization: Ethnohistory Associates
  7. Message-ID: <313DD1C8.363C@interramp.com>
  8. References: <313C7F02.5D54@interramp.com> <Pine.A32.3.91.960306003353.206714F-100000@black.weeg.uiowa.edu>
  9. NNTP-Posting-Host: ip119.kalamazoo.mi.interramp.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win95; U)
  14.  
  15. The Amorphous Mass wrote:
  16. > On Tue, 5 Mar 1996, James A. Clifton wrote:
  17. > > I need to have an array of fixed-length strings in a structure.
  18. > > The problem I am having is trying to reference a particular string
  19. > > in the array:
  20. > >
  21. > > typedef struct ss {
  22. > > /* some other data */
  23. > > char sa[N][M];
  24. > > } ss;
  25. > >
  26. > > ss s;
  27. > >
  28. > > Now how do I reference the Nth string???
  29. >   s.sa[N]
  30.  
  31. I've tried this and both bcc & gcc give me "invalid indirection"
  32.  
  33. To further complicate I am actually using an array of these
  34. structures so I need:
  35.  
  36. ss s[MAX_ARR];
  37.  
  38. {
  39. /* the mth structure's nth string */
  40. printf("%i\n", s[m].sa[m]);
  41. /* compiler gives me "invalid indirection here */
  42. }
  43.